ARG BASE_IMAGE=winsleo/desktop:pytorch2.1.2-cuda12.1-cudnn8-devel
FROM $BASE_IMAGE

WORKDIR /opt
RUN apt-get install -y --no-install-recommends libjpeg-dev libglm-dev \
libgl1-mesa-glx libegl1-mesa-dev mesa-utils xorg-dev freeglut3-dev libxcb-keysyms1
RUN pip install "numpy<2" "opencv-python<4.8"
ENV CMAKE_ARGS="-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
RUN git clone --branch v0.2.4 https://github.com/facebookresearch/habitat-sim.git \
&& cd habitat-sim && pip install --no-cache-dir -r requirements.txt \
&& python setup.py install --bullet --with-cuda && cd ..
RUN git clone --branch v0.2.4 https://github.com/facebookresearch/habitat-lab.git \
&& cd habitat-lab && pip install --no-cache-dir -e habitat-lab \
&& pip install --no-cache-dir -e habitat-baselines

CMD [ "bash", "/scripts/startup.sh", "bash"]